package com.d0326;

import java.util.Collections;
import java.util.List;
import java.util.Vector;

public class TestCollections {
    public static void main(String[] args) {
        List<Student> list= new Vector<>();
        Student s1=new Student("zhangsan ",22,51);
        Student s2=new Student("lisi ",33,51);
        Student s3=new Student("wangwu ",12,51);
        Student s4=new Student("zhaoliu ",17,51);
        list.add(s1);
        list.add(s2);
        list.add(s3);
        list.add(s4);
        //Collections.sort(list);
        //Collections.reverse(list);
        /*for (Integer i:
             list) {
            System.out.println(i);
        }*/
       int stu=Collections.binarySearch(list,s1);
        System.out.println(stu);
       //System.out.println(Collections.max(list));
       // list.forEach(i  -> System.out.println(i) );
    }
}
